{extend name="_public/table_page" /}

{block name="search-form"}
<div class="layui-row">
    <form class="layui-form layui-col-md12 we-search" action="{:request()->url()}" method="get">
        <div class="layui-inline">
            <input type="text" name="uname" value="{$Request.get.uname}" placeholder="请输用户名称（支持模糊搜索）" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-inline">
            <select name="status">
                <option value="">请选择分类状态</option>
                <option value="0" {eq name="$Request.get.status" value="0"}selected{/eq}>待审核</option>
                <option value="1" {eq name="$Request.get.status" value="1"}selected{/eq}>已通过</option>
                <option value="2" {eq name="$Request.get.status" value="2"}selected{/eq}>已拒绝</option>
                {/volist}
            </select>
        </div>
        <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
    </form>
</div>
{/block}
{block name="button"}
<div class="weadmin-block" style="overflow: hidden">
    {if auth("$classuri/del")}
    <button class="layui-btn layui-btn-xs" data-post-batch='{:url("$classuri/del")}' data-title="批量删除">批量删除</button>
    {/if}

</div>
{/block}

{block name="table"}
<table class="layui-table" lay-even lay-skin="line" lay-size="sm">
    <thead>
    <tr>
        <th>
            <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
        </th>
        <th>id</th>
        <th>用户id</th>
        <th>平台银行卡</th>
        <th>充值编号</th>
        <th>充值金额</th>
        <th>兑换砖石数量</th>
        <th>打款凭证</th>
        <th>状态</th>
        <th>操作</th>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr style="background-color: white;">
        <td>
            <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo.id}'><i class="layui-icon">&#xe605;</i></div>
        </td>
        <td>{$vo.id}</td>
        <td>{$vo.uname}</td>

        <td>{$vo.kaihuhang}--{$vo.kname}--{$vo.kahao}</td>
        <td>{$vo.ordernum}</td>
        <td>{$vo.price}</td>
        <td>{$vo.num}</td>

        <td><img src="{$vo.pay_img}" class="data-tips-image" alt=""></td>

        <td>
            {if $vo.status eq 0 }待审核{/if}
            {if $vo.status eq 1 }已通过{/if}
            {if $vo.status eq 2 }已拒绝{/if}
        </td>
        <td>
             {if $vo.status eq 0 }
                {if auth("$classuri/change")}
                <button class="layui-btn  layui-bg-orange layui-btn-xs layui-btn-{:$vo.status?'warm':'primary'}" href="javascript:;" data-confirm="确定操作该条数据吗？"
                        data-post='{:url("$classuri/change")}' data-param='id={$vo.id}&status={:abs($vo.status+1)}'>通过

                </button>
                {/if}

                {if auth("$classuri/change")}
                <button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-{:$vo.status?'warm':'primary'}" href="javascript:;" data-confirm="确定操作该条数据吗？"
                        data-post='{:url("$classuri/change")}' data-param='id={$vo.id}&status={:abs($vo.status+2)}'>拒绝
                </button>
                {/if}
             {/if}

             {if auth("$classuri/del")}
             <button class="layui-btn layui-btn-xs" href="javascript:;"
                    data-confirm="确定要删除吗！" data-post='{:url("$classuri/del")}' data-param='ids={$vo.id}'>
                删除
             </button>
             {/if}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{$page|raw}
<script>
    var audios = document.getElementsByTagName("audio");
    // 暂停函数
    function pauseAll() {
        var self = this;
        [].forEach.call(audios, function (i) {
            // 将audios中其他的audio全部暂停
            i !== self && i.pause();
        })
    }
    // 给play事件绑定暂停函数
    [].forEach.call(audios, function (i) {
        i.addEventListener("play", pauseAll.bind(i));
    })
</script>
{/block}
